package com.tarena.lbs.attach.timer;

import com.tarena.lbs.attach.api.AttachApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class TimerDeprecatedAttach {
    @Autowired
    private AttachApi attachApi;

    @XxlJob("deleteAttach")
    public void deleteAttachDeprecated() {
        log.info("定时任务开始执行");
        int rows = attachApi.deleteUnBindAttach();
        log.info("定时任务执行完毕，删除了{}条数据",rows);
    }
}
